-
-
Notifications
You must be signed in to change notification settings - Fork 180
Implement TCPv4 protocol #1779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Implement TCPv4 protocol #1779
Conversation
Thanks for your contribution! I'll look hopefully next week into this, as I'm at the EuroRust conference. |
pub mod ip4_config2; | ||
pub mod pxe; | ||
pub mod snp; | ||
pub mod tcpv4; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's split the uefi-raw changes into a separate PR, we can review and merge that first. See https://github.com/rust-osdev/uefi-rs/blob/main/uefi-raw/api_guidelines.md for some general guidance on uefi-raw.
#[derive(Debug)] | ||
#[repr(C)] | ||
pub struct Tcpv4AccessPoint { | ||
pub use_default_address: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub use_default_address: bool, | |
pub use_default_address: Boolean, |
(from crate::Boolean
)
} | ||
|
||
impl Tcpv4AccessPoint { | ||
pub fn new(connection_mode: Tcpv4ConnectionMode) -> Tcpv4AccessPoint { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The uefi-raw API should stick closely to the spec; convenience methods like this should generally go in uefi
instead.
pub type_of_service: u8, | ||
pub time_to_live: u8, | ||
pub access_point: Tcpv4AccessPoint, | ||
pub option: Option<&'a Tcpv4Option>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use raw pointers in uefi-raw
This PR implements the UEFI TCPv4 protocol, building upon #1130. As-is, the code performs well in a custom bootloader.
Overview
This implementation adds support for the
EFI_TCP4_PROTOCOL
andEFI_TCP4_SERVICE_BINDING_PROTOCOL
as defined in the UEFI specification (Section 28.1). It enables UEFI applications to establish TCP connections, transmit and receive data over the network.Changes
uefi-raw
Closed
,Listen
,SynSent
,Established
, etc.)uefi
Tcpv4ServiceBinding
for creating TCP protocol instancesTcpv4
protocol wrapper with higher-level APIreceive_exact()
for reading exact byte countsKey Features
Connection Modes: Support for both client and server TCP connections
Async Operations: All I/O operations wrap async operations in high-level sync interface
DHCP Integration: Automatic retry logic when DHCP is still configuring the network
NO_MAPPING
status during network initializationExample Usage
Current Limitations
UnmodelledPtr
(implementation pending)UnmodelledPtr
(implementation pending)Future Work
accept
) implementation (low priority)Checklist
Closes #1130